home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / programming / misc / ada1110b.lha / AmigaSources / ivars.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-10  |  9.8 KB  |  220 lines

  1. /*
  2.  * Copyright (C) 1985-1992  New York University
  3.  * 
  4.  * This file is part of the Ada/Ed-C system.  See the Ada/Ed README file for
  5.  * warranty (none) and distribution info and also the GNU General Public
  6.  * License for more details.
  7.  
  8.  */
  9. /*    +---------------------------------------------------+
  10.       |                                                   |
  11.       |      I N T E R P R E T E R   V A R I A B L E S    |
  12.       |                                                   |
  13.       |                    (C Version)                    |
  14.       |                                                   |
  15.       |   Adapted From Low Level SETL version written by  |
  16.       |                                                   |
  17.       |                    Monte Zweben                   |
  18.       |                 Philippe Kruchten                 |
  19.       |                 Jean-Pierre Rosen                 |
  20.       |                                                   |
  21.       |    Original High Level SETL version written by    |
  22.       |                                                   |
  23.       |                     Clint Goss                    |
  24.       |                  Tracey M. Siesser                |
  25.       |                  Bernard D. Banner                |
  26.       |                  Stephen C. Bryant                |
  27.       |                    Gerry Fisher                   |
  28.       |                                                   |
  29.       |                 C version written by              |
  30.       |                                                   |
  31.       |                  Robert B. K. Dewar               |
  32.       |                                                   |
  33.       +---------------------------------------------------+     */
  34.  
  35.  
  36. /* Revision History
  37.   19 Jun 1985, 10:11 (RBKD)
  38.   First complete version, from low level version 10-23-1984
  39.  */
  40. /*  This module contains variables used in all parts of the interpretor */
  41.  
  42. /*
  43.  *  Memory lay-out
  44.  *  --------------
  45.  */
  46.  
  47. extern  int *stack_segments [MAX_TASKS]; /* one stack segment for each task */
  48. extern  int task_stackptr [MAX_TASKS];   /* stack pointers for task stacks */
  49. extern  unsigned int data_segments_dim;  /* dimension of data_segments */
  50. extern  int **data_segments;             /* one data segment for each cunit */
  51. extern  int *data_seglen;                /* length of data segments */
  52. extern  unsigned int code_segments_dim;  /* dimension of code_segments */
  53. extern  char **code_segments;            /* segments containing code */
  54. extern  int *code_seglen;                /* length of code segments */
  55. extern  int *cur_stack;                  /* current stack segment */
  56. extern  int cur_stackptr;                /* stack ptr for cur_stack */
  57. extern  char *cur_code;                  /* current code segment */
  58. extern  int num_cunits;                  /* number of compilation units */
  59.  
  60. /*
  61.  *  Context of a task
  62.  *  -----------------
  63.  */
  64.  
  65. extern  int cs;       /* index of current code_segment in code_segments */
  66. extern  int ip;       /* instruction pointer in cur_code */
  67. extern  int sp;       /* stack pointer */
  68. extern  int sfp;      /* stack frame pointer */
  69. extern  int bfp;      /* block frame pointer */
  70. extern  int exr;      /* exception register */
  71. extern  int lin;      /* line number for tracing */
  72.  
  73. /*
  74.  *  Global context (not preserved by context switch)
  75.  *  ------------------------------------------------
  76.  */
  77.  
  78. extern  int tp;                /* index of current task in stack_segments */
  79. extern  int *heap_next;        /* top of heap for allocation */
  80. extern  int heap_base;         /* segment number of heap */
  81. extern  int *heap_addr;        /* address of beginning of heap */
  82. extern  long next_clock;        /* next time to call clock_interrupts */
  83. extern  long time_offset;       /* cumulative skipped time for simulated time */
  84. extern  int next_clock_flag;   /* request to check the clock (task waiting) */
  85. extern  int simul_time_flag;   /* run with simulated time (versus real time) */
  86. extern  int time_slicing_flag; /* time slicing (vs schedule at system call) */
  87. extern  long time_slice;        /* length of time slice (500 ms default) */
  88. extern  int tasking_trace;     /* TRUE to trace tasking */
  89. extern  int rendezvous_trace;  /* TRUE to trace rendezvous */
  90. extern  int signal_trace;      /* TRUE to trace signalling */
  91. extern  int debug_trace;       /* TRUE for general debugging trace */
  92. extern  int exception_trace;   /* TRUE to trace exceptions */
  93. extern  int call_trace;        /* TRUE to trace calls */
  94. extern  int line_trace;        /* TRUE to trace line numbers */
  95. extern  int instruction_trace; /* TRUE to trace instructions */
  96.  
  97. /* Number of slots */
  98.  
  99. extern  unsigned int data_slots_dim;      /* dimension of data_slots */
  100. extern  char **data_slots;
  101. extern  unsigned int code_slots_dim;      /* dimension of code_slots */
  102. extern  char **code_slots;
  103. extern  unsigned int exception_slots_dim; /* dimension of exception_slots */
  104. extern  char **exception_slots;
  105.  
  106. /* Global Variables (for main interpreter) */
  107.  
  108. extern  int max_mem;                      /* size of a heap segment */
  109. extern  int w;                            /* used by GET_WORD */
  110. extern  struct tt_fx_range *temp_template;/* fixed point work template */
  111.  
  112. extern  int bse,bas1,bas2,bas3,bas4;      /* address base values */
  113. extern  int off,off1,off2,off3,off4;      /* address offset values */
  114. extern  int *ptr,*ptr1,*ptr2,*ptr3,*ptr4; /* memory addresses */
  115. extern  int value,val1,val2;              /* operands for int operations */
  116. extern  int length1,length2;              /* for array operations */
  117. extern  long lvalue,lval1,lval2;          /* operands for long operations */
  118. extern  long fval1,fval2,fvalue;          /* operands for fixed operations */
  119. extern  float rvalue,rval1,rval2;         /* operands for float operations */
  120. extern  int val_high,val_low;             /* low/high of INT range */
  121. extern  int result,delta;                 /* used in fixed point */
  122. extern  int size;                         /* size of object */
  123. extern  int attribute;                    /* attribute code */
  124. extern  int slot;                         /* for create structure */
  125. extern  int component_size;               /* size of array component */
  126. extern  long now_time;                     /* current time */
  127. extern  int to_type;                      /* type from template */
  128. extern  int discr_list[MAX_DISCR];        /* accumulate list of discriminants */
  129. extern  int nb,i;                         /* loop counters etc */
  130. extern  int overflow;                     /* overflow flag from arith routines */
  131. extern  int nb_discr;                     /* number of discriminants */
  132. extern  int nb_dim;                       /* dimension of array */
  133. extern  int ratio,power;                  /* used in attribute processing */
  134. extern  int d,n;                          /* temporaries */
  135. extern  int old_cs;                       /* old value of cs */
  136. extern  int jump;                         /* jump address */
  137. extern  int lim;                          /* limit in for loop */
  138. extern  struct bf *bfptr;                 /* pointer to block frame */
  139. extern  int *tfptr1,*tfptr2;              /* pointers to task frames */
  140. extern  int cur_col;                      /* temporary for predef */
  141.  
  142. /*
  143.  * I/O trace flags used to get trace prints when reading and writing
  144.  * intermediate files. A trace level is one of the following:
  145.  *               0           no trace
  146.  *               1           brief trace
  147.  *               2           full trace
  148.  */
  149. extern  int iot_ifile; /* current trace level for ifile */
  150. extern  int iot_ais_r; /* trace level for ais files read */
  151. extern  int iot_lib_r; /* trace level for lib files read */
  152. extern  char iot_ifile_type;
  153.  
  154. extern  int break_point;       /* next break point */  
  155.  
  156. extern  int fix_val1[20];      /* fixed point intermediate values */
  157. extern  int fix_val2[20];     
  158. extern  int fix_resu[20];     
  159. extern  int fix_temp[20];     
  160. extern  int mul_fact[20];     
  161. extern  int div_fact[20];     
  162.  
  163. extern  int arith_overflow;
  164. extern  int sgn;
  165. extern  int last_task;
  166. extern  int *free_list;
  167. extern  int raise_cs;
  168. extern  int raise_lin;
  169. extern  char *raise_reason;
  170.  
  171. /*
  172.  *                             P R E D E F
  173.  */
  174.  
  175. /* Define maximum number of files and AFCB vector to match */
  176.  
  177. /*
  178.  * Note that file numbers are 1's origin subscripts into this vector, so that
  179.  * the file number value of 1 corresponds to the first entry, i.e. afcbs[0]
  180.  */
  181.  
  182. #define MAXFILES 20
  183. extern  struct afcb *(afcbs[MAXFILES]);
  184.  
  185. /* Variables for predef */
  186.  
  187. extern  int operation;         /* operation for predef. set in the main loop */
  188. extern  int data_exception;    /* exception to raise on data error */
  189. extern  int filenum;           /* number of current file */
  190. extern  int standard_in_file;  /* index of standard input file */
  191. extern  int standard_out_file; /* index of standard output file */
  192. extern  int current_in_file;   /* index of current default input file */
  193. extern  int current_out_file;  /* index of current default output file */
  194. extern  int current_in_file_saved;   
  195.      /* duplicate index of current default input file */
  196. extern  int current_out_file_saved;  
  197.      /* duplicate index of current default output file */
  198. extern  int file_offset;       /* Offset due to file argument in the stack */
  199.                          /* 2 if explicit file, 0 if default file */
  200. extern  struct tfile *tfiles;  /* linked list of temporary files */
  201.  
  202. /*
  203.  * The area work_string is used to hold an ASCIIZ string. It is a strictly
  204.  * temporary area which can be destroyed by almost any function. Anyone
  205.  * who needs to keep this string value must copy it using make_string.
  206.  *
  207.  * Note that the maximum length of strings in the Ada system is 4K bytes.
  208. */
  209.  
  210. extern  char work_string[4096];
  211.  
  212. /* The task stack size for created tasks is given by new_task_size,
  213.  * and the size of the main task is given by main_task_size.
  214.  * These are initialized in imain.c; and can be set by program options
  215.  * -s and -p, respectively.
  216.  */
  217.  
  218. extern  int main_task_size;
  219. extern  int new_task_size;
  220.